<template>
	<div class="page version-description">
		<div class="scroll-view">
			<customHeader middleTitle="版本说明" />
			<div class="page-body">
				<div v-if="appVersion" class="head">
					同福商家 v{{appVersion}}新特性
				</div>
				<img style="width:100%;" v-for="(item,index) in versionImags" :key="index" :src="item" alt="">
			</div>
		</div>
	</div>
</template>

<script>
import Vue from 'vue';
import jsBridge from '../../tools/jsBridge.js';
import customHeader from "../../components/header/header";
import config from "../../base/profile/config.json";
export default {
	name: 'versionDescription',
	data() {
		return {
			appVersion: '',
			versionImags:[],
			androidImages:[config.shopImgUrlPrefix+'2019/07/23/17/198791563872738.png',config.shopImgUrlPrefix+'2019/07/23/17/976351563872846.png',config.shopImgUrlPrefix+'2019/07/23/17/275311563872885.png'],
			iosImages:[config.shopImgUrlPrefix+'2019/07/23/17/198791563872738.png',config.shopImgUrlPrefix+'2019/07/23/17/976351563872846.png',config.shopImgUrlPrefix+'2019/07/23/17/275311563872885.png']
		};
	},
	methods: {
		getPlatform() {
			let ua = navigator.userAgent.toLowerCase();
			if (ua.indexOf('android') >= 0) {
				this.isAndroid = true;
			}else{
				this.isAndroid = false;
			}
		},
		getCurrentAppVersion(callback) {
			let self = this;
			jsBridge.getCurrentAppVersion(result => {
				if (result.success.toString() == 'true') {
					this.appVersion = result.resultObject;
					callback && callback();
				} else {
					Toast('获取APP版本失败！');
				}
			});
		},
	},
	components: {
		customHeader,
	},
	mounted() {
		this.getPlatform();
		if(this.isAndroid){
			this.versionImags = this.androidImages;
		}else{
			this.versionImags = this.iosImages;
		}
		this.getCurrentAppVersion();
	},
};
</script>
<style lang='scss' scoped>
@import 'versionDescription';
</style>
